import 'package:car_baidu/core/model/l_l_car_list_model_entity.dart';

lLCarListModelEntityFromJson(
    LLCarListModelEntity data, Map<String, dynamic> json) {
  if (json['success'] != null) {
    data.success = json['success'];
  }
  if (json['carList'] != null) {
    data.carList = (json['carList'] as List)
        .map((v) => LLCarListModelCarList().fromJson(v))
        .toList();
  }
  return data;
}

Map<String, dynamic> lLCarListModelEntityToJson(LLCarListModelEntity entity) {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['success'] = entity.success;
  data['carList'] = entity.carList.map((v) => v.toJson()).toList();
  return data;
}

lLCarListModelCarListFromJson(
    LLCarListModelCarList data, Map<String, dynamic> json) {
  if (json['strTEID'] != null) {
    data.strTEID = json['strTEID'].toString();
  }
  if (json['strCarUUID'] != null) {
    data.strCarUUID = json['strCarUUID'].toString();
  }
  if (json['nMileage'] != null) {
    data.nMileage = json['nMileage'] is String
        ? int.tryParse(json['nMileage'])
        : json['nMileage'].toInt();
  }
  if (json['nCarModelID'] != null) {
    data.nCarModelID = json['nCarModelID'] is String
        ? int.tryParse(json['nCarModelID'])
        : json['nCarModelID'].toInt();
  }
  if (json['strCarrVIN'] != null) {
    data.strCarrVIN = json['strCarrVIN'].toString();
  }
  if (json['strCarPlateNum'] != null) {
    data.strCarPlateNum = json['strCarPlateNum'].toString();
  }
  if (json['strModelName'] != null) {
    data.strModelName = json['strModelName'].toString();
  }
  if (json['strEngineNumber'] != null) {
    data.strEngineNumber = json['strEngineNumber'].toString();
  }
  if (json['nInitMileage'] != null) {
    data.nInitMileage = json['nInitMileage'] is String
        ? int.tryParse(json['nInitMileage'])
        : json['nInitMileage'].toInt();
  }
  return data;
}

Map<String, dynamic> lLCarListModelCarListToJson(LLCarListModelCarList entity) {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['strTEID'] = entity.strTEID;
  data['strCarUUID'] = entity.strCarUUID;
  data['nMileage'] = entity.nMileage;
  data['nCarModelID'] = entity.nCarModelID;
  data['strCarrVIN'] = entity.strCarrVIN;
  data['strCarPlateNum'] = entity.strCarPlateNum;
  data['strModelName'] = entity.strModelName;
  data['strEngineNumber'] = entity.strEngineNumber;
  data['nInitMileage'] = entity.nInitMileage;
  return data;
}
